package cn.lili.modules.order.order.client;

import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.distribution.entity.dos.Distribution;
import cn.lili.modules.order.fallback.OrderItemFallback;
import cn.lili.modules.order.order.entity.dos.RankingDistribution;
import cn.lili.modules.order.order.entity.dto.RankingFySetParentChildCountDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 子订单 client
 *
 * @author Chopper
 * @version v1.0 2021-11-08 09:52
 */
@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.ORDER_SERVICE, contextId = "ranking-distribution", fallback = OrderItemFallback.class)
public interface RankingDistributionClient {

    @PostMapping("/save")
    public Boolean save(@RequestBody Distribution distribution);

    @PostMapping("/fySetParentSyncMallRankingDistribution")
    @ApiOperation("飞语绑定上级,检测是否是商城店主,并对商城的店主执行下级+1操作")
    public Boolean fySetParentSyncMallRankingDistribution(@RequestBody RankingFySetParentChildCountDTO dto);

    @PostMapping("/removeRankingDistribution")
    public Boolean removeRankingDistribution(@RequestBody Distribution distribution);

    @PostMapping("/updateRankingDistribution")
    public Boolean updateRankingDistribution(@RequestBody RankingDistribution dis);

    @PostMapping("/feign/clearParentInfo")
    @ApiOperation("清空上级ID")
    Boolean clearParentInfo(@RequestBody Distribution dis);
}
